package com.mall.order.mapper;

import com.mall.order.model.dto.OrderDto;
import com.mall.order.model.vo.OrderVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper接口
 */
public interface OrderMapper
{
    /**
     * 查询订单
     *
     * @param id 订单主键
     * @return 订单
     */
    public OrderVo selectOrderById(Long id);

    /**
     * 查询订单列表
     *
     * @param orderDto 订单
     * @return 订单集合
     */
    public List<OrderVo> selectOrderList(OrderDto orderDto);

    /**
     * 新增订单
     *
     * @param orderDto 订单
     * @return 结果
     */
    public int insertOrder(OrderDto orderDto);

    /**
     * 修改订单
     *
     * @param orderDto 订单
     * @return 结果
     */
    public int updateOrder(OrderDto orderDto);

    /**
     * 删除订单
     *
     * @param id 订单主键
     * @return 结果
     */
    public int deleteOrderById(Long id);

    /**
     * 批量删除订单
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrderByIds(Long[] ids);

    public OrderVo selectOrderBySn(@Param("orderNo") String orderNo);

    /**
     * 获取报名订单
     */
    List<OrderVo> selectSignupOrderList(OrderDto orderDto);

    long selectSignupNumByCourseId(@Param("courseId") Long courseId);
}
